package cn.seaboot.admin.net.prop;

import cn.seaboot.admin.net.web.HttpCtrl;
import cn.seaboot.commons.http.HttpProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author Mr.css
 * @version 2022-07-18 18:29
 */
@Component
@ConfigurationProperties(prefix = "boot-httpclient")
public class HttpClientProperties extends HttpProperties {
    private static final long serialVersionUID = -4845215089868067815L;
    /**
     * 如果需要配置多个Client
     */
    private Map<String, HttpProperties> configMap;


    /**
     * 配置之后，可以将当前服务器的请求，转发到其它服务器，获取其它服务器的相关数据，
     * 主要解决前端的跨域问题。
     * <p>
     * {@link HttpCtrl}
     */
    private Map<String, String> proxy;

    public Map<String, HttpProperties> getConfigMap() {
        return configMap;
    }

    public void setConfigMap(Map<String, HttpProperties> configMap) {
        this.configMap = configMap;
    }

    public Map<String, String> getProxy() {
        return proxy;
    }

    public void setProxy(Map<String, String> proxy) {
        this.proxy = proxy;
    }

    @Override
    public String toString() {
        return "HttpClientConfiguration{" +
                "configMap=" + configMap +
                ", proxy=" + proxy +
                '}';
    }
}
